Repository navigation
feat(cli): add voltage context to inspect effective scope - #11
Merged
Merged
Conversation
thebrandonlucas
force-pushed
the
feat/cli-context
branch
2 times, most recently
from
October 7, 2026 12:56
028dc66 to
6a1c988
Compare
thebrandonlucas
changed the base branch from
master
to
feat/cli-interaction-progress
October 7, 2026 13:03
thebrandonlucas
force-pushed
the
feat/cli-context
branch
2 times, most recently
from
October 7, 2026 17:11
e0da34b to
3e8017c
Compare
This was referenced Oct 7, 2026
thebrandonlucas
marked this pull request as ready for review
October 7, 2026 17:18
tee8z
previously approved these changes
Oct 7, 2026
thebrandonlucas
force-pushed
the
feat/cli-context
branch
from
October 7, 2026 18:28
3e8017c to
4338a9b
Compare
thebrandonlucas
force-pushed
the
feat/cli-context
branch
from
October 7, 2026 20:53
4338a9b to
0cd2c8d
Compare
tee8z
requested changes
Oct 7, 2026
voltage context reports the effective profile, account, credential kind and location, organization, environments, wallet, webhook, API URL, and configuration directory, each with its source (flag, profile, environment, default, or unset). Precedence stays in Settings::scope, which now also reports sources. Inspection reads no saved secret, makes no network request, and does not create the configuration directory. It also lists ignored_variables: VOLTAGE_* scope, credential, or config-directory variables that are set but supply nothing because a flag or the selected profile takes precedence. Credential selection is shared with auth, so credential_problem reports the same typed rejection commands make: a blank VOLTAGE_API_KEY, no or multiple saved credentials, an unknown name, or an API key bound to a different organization or environment. The provenance types stay crate-private although config is a public module.
thebrandonlucas
force-pushed
the
feat/cli-context
branch
from
October 8, 2026 00:44
0cd2c8d to
2a61b94
Compare
tee8z
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
voltage context, which shows what a command would act on without running one: the effective profile, account, organization, environments, wallet, webhook, API URL, configuration directory andconfig.tomlpath, each with where it came from (flag,profile,environment,default, orunset).keychain,file, orenvironment) without reading its secret, plus a typedcredential_problemwhen commands would reject the selection:empty_api_key,no_credential,multiple_credentials,unknown_credential, orbound_elsewhere(a saved API key used outside its organization or environment). Context and every command shareauth::select, so inspection reports exactly the rejection a command would make.ignored_variables:VOLTAGE_*scope, credential, or config-directory variables that are set but supply nothing because a flag or the selected profile takes precedence. A leftover export, or a profile silently overriding your environment, is the surprise this command exists to explain.Settings::scope, which now also reports sources (Settings::sourced_scope), socontextcannot drift from what commands actually use.Bottom of stack #18 (#11 → #17 → #14 → #15); based on
master.Example
{ "organization_id": {"value": "2222…", "source": "flag"}, "wallet_id": {"value": "3333…", "source": "environment"}, "environment_ids": {"value": [], "source": "unset"}, "account": {"value": null, "source": "unset"}, "credential": null, "api_url": {"value": "https://voltageapi.com/v1", "source": "default"}, "config_file": {"path": "…/config.toml", "exists": false}, "ignored_variables": ["VOLTAGE_ORGANIZATION_ID"] }(
dataonly; trimmed.) Human output on a terminal is still the generic envelope rendering; a dedicatedname value (source)view is deferred to the human-output PR.Review exceptions
Source,ScopeSources,sourced_directory,Settings::sourced_scopeandSettings::config_filearepub(crate)even thoughconfigis a public module.auth::select,Selected,Rejected, andconfig::CredentialProblemarepub(crate);ambient_api_keystays private. The ignored-variable rules live inconfigbeside the precedence they describe.unsafe, lint exceptions, project traits, getters, or dependencies.Verification
cargo fmt --checkcargo clippy --locked --all-targets -- -D warningscargo machete --with-metadatacargo test --locked: integration tests cover profile-over-ambient precedence, flag-over-variable precedence,ignored_variables, a blankVOLTAGE_API_KEY, secret absence from output, no HTTP requests, and no configuration directory createdpython3 scripts/check-coverage.py